<link rel="stylesheet" type="text/css" href="<?php echo STATIC_URL . '/media/skin/classic/like-to-social-networks.css?v=' . SKIN_VERSION ?>" />
<div class="fb_recommend">
    <!-- Facebook like -->
    <div class="share-to-facebook">
		<div class="fb-like"
			 data-layout="<?php echo $this->layout ? $this->layout : 'button_count' ?>"
			 data-href="<?php echo $this->url_facebook ?>"
			 data-send="<?php echo $this->send ? 'true' : 'false' ?>"
			 data-width="<?php echo !empty($this->width)?$this->width:'auto' ?>"
			 data-show-faces="<?php $this->show_faces?'true':'false' ?>"
			 data-ref="<?php echo $this->id_user ?>"
			<?php if( !empty($this->font) ):?>
				data-font="<?php echo $this->font ?>"
			<?php endif;?>
			>
		</div>
    </div>

    <!-- Google Plus -->
    <div class="googleplus-like">
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
        <g:plusone action="share"
                href="<?php echo $this->url ?>"
                annotation="bubble"
                size="medium"
                width=32>
        </g:plusone >
    </div>

    <!-- Twitter -->
    <div class="twitter-like">
        <?php
            // Ref: https://dev.twitter.com/docs/tweet-button
            $text = '';
            if (!empty($this->contest_name)) {
                $text = '"'.$this->contest_name.'" contest : ';
            }
            $text .= $this->title.' - ';
            $text = urlencode($text);
            $text = preg_replace('/\+/', '%20', $text);
            $url = Core_Util::getBitlyUrl($this->url);
        ?>
        <a href="https://twitter.com/intent/tweet?original_referer=<?php echo urlencode($this->url)?>&text=<?php echo $text?>&tw_p=tweetbutton&url=<?php echo urlencode($url)?>" class="twitter-share-button"><span class="label" id="l">Tweet</span></a>
        <script>!function(d,s,id){
            var js,fjs=d.getElementsByTagName(s)[0];
            if(!d.getElementById(id)){
            js=d.createElement(s);
            js.id=id;
            js.src="//platform.twitter.com/widgets.js";
            fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
        </script>
    </div>

    <!-- Pin it -->
    <!-- Ref
    http://support.addthis.com/customer/portal/articles/381237-third-party-buttons#pinterest-pinit
    https://www.addthis.com/get/sharing#.UNfQj-Skq8o -->
    <?php 
        $text = '';
        if (!empty($this->contest_name)) {
            $text = '"' . $this->contest_name . '" contest : ';
        }
        $text .= $this->title;
    ?>
    <a href="http://pinterest.com/pin/create/button/?<?php echo http_build_query(array(
            'url'   =>  $this->url,
            'media' =>  $this->img,
            'description'   =>  $text
        ))?>"
       class="pin-it-button"
       count-layout="horizontal">
       <img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
    </a>
    <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>

</div>
<script type="text/javascript">
    $(document).ready(function() {
    });
</script>
